  var email = document.getElementById("email");
  var password = document.getElementById("password");
  document.getElementById("login_button").addEventListener("click", check_input);

  function check_input() {
      var my_email = email.value.trim();
      var my_password = password.value.trim();
      if (my_email.length == 0) {
          document.getElementById("my_prompt").innerHTML = "邮箱不能为空！";

      } else if (!check_email(my_email)) {
          document.getElementById("my_prompt").innerHTML = "请输入正确邮箱！";
      } else if (my_password.length == 0) {
          document.getElementById("my_prompt").innerHTML = "密码不能为空！";
      }

  }

  function check_email(str) {
      var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
      return reg.test(str);
  }
